package cn.jantd.modules.demo.file.service.impl;

import cn.jantd.modules.demo.file.entity.SysFile;
import cn.jantd.modules.demo.file.mapper.SysFileMapper;
import cn.jantd.modules.demo.file.service.ISysFileService;
import cn.jantd.modules.demo.sso.entity.SysSso;
import cn.jantd.modules.demo.sso.mapper.SysSsoMapper;
import cn.jantd.modules.demo.sso.service.ISysSsoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @Author xiagf
 * @date 2019-07-04
 */
@Service
@Slf4j
public class SysFileServiceImpl extends ServiceImpl<SysFileMapper, SysFile> implements ISysFileService {

    @Autowired
    private SysFileMapper userMapper;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addUser(SysFile user) {
        this.save(user);
    }

    @Override
    @CacheEvict(value = "loginUser_cacheRules", allEntries = true)
    @Transactional(rollbackFor = Exception.class)
    public void editUser(SysFile user) {
        this.updateById(user);
    }


}
